from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from admin import adminPrint
from user import userPrint
from config import Config

app = Flask(__name__)


def start():
    # print(app.config.items())
    app.register_blueprint(adminPrint)
    app.register_blueprint(userPrint)
    app.config.from_object(Config)
    print(app.config["SQLALCHEMY_DATABASE_URI"])
    return app


db = SQLAlchemy(start())

from view import getData
item,datas = getData()

@app.route('/')
def hello_world():
    return render_template("index.html", item={"item":item,"datas":datas})


if __name__ == '__main__':
    app.run()
